<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html lang="zh">
<head>
    <%@include file="/lyear/common/head.jsp" %>
</head>

<body>

<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <%@include file="/lyear/common/aside.jsp" %>
        <!--End 左侧导航-->

        <!--头部信息-->
        <%@include file="/lyear/common/top.jsp" %>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <ul class="nav nav-tabs page-tabs">
                                <li class="active"><a href="#!">修改项目信息</a></li>
                            </ul>
                            <form action="${pageContext.request.contextPath}/proj/updateProj/${projInfo.id}" method="post" enctype="multipart/form-data">
                                <div class="tab-content">
                                    <div class="tab-pane active">
                                        <div class="form-group">
                                            <label for="cname" >项目名</label>
                                            <input class="form-control" type="text" id="cname" name="name" value="${projInfo.name}">
                                        </div>
                                        <div class="form-group">
                                            <label for="categoryName">所属分类</label>
                                            <br>
                                            <c:forEach items="${categoryList}" var="category">
                                                <input type="checkbox" name="categoryName" value="${category.name}" id="categoryName"
                                                <c:forEach items="${projInfo.cateNameList}" var="category1">
                                                    <c:if test="${category.name==category1}">
                                                       checked
                                                </c:if>
                                                </c:forEach>
                                                >
                                                <span>${category.name}</span>&nbsp;&nbsp;&nbsp;
                                            </c:forEach>
                                        </div>

                                        <div class="form-group">
                                            <label for="url">项目路径</label>
                                            <input class="form-control" type="text" id="url" name="url" value="${projInfo.url}" >
                                        </div>
                                        <div class="form-group">
                                            <label for="categoryName">所用技术</label>
                                            <br>
                                            <c:forEach items="${technologyList}" var="technology">
                                                <input type="checkbox" name="technologyName" value="${technology.name}" id="technologyName"
                                                    <c:forEach items="${projInfo.techNameList}" var="technology1">
                                                    <c:if test="${technology.name==technology1}"> checked</c:if>
                                                    </c:forEach>
                                                >
                                                <span>${technology.name}</span>&nbsp;&nbsp;&nbsp;
                                            </c:forEach>
                                        </div>
                                        <div class="form-group">
                                            <label for="authorName">项目作者</label>
                                            <input class="form-control" type="text" id="authorName" name="authorName"
                                                value="${projInfo.authorNameList}"
                                            >
                                        </div>
                                        <div class="form-group">
                                            <label for="info">项目简介</label>
                                            <textarea class="form-control" id="info" rows="5"
                                                      name="info">${projInfo.info}</textarea>
                                        </div>
                                        <span id="queren" style="font-size: 12px;color: red"></span>
                                        <div class="form-group">
                                            <button  type="submit" class="btn btn-primary" id="addProj" onclick="return check(this.form)">确认修改
                                            </button>

                                            <button type="button" class="btn btn-default"
                                                    onclick="javascript:history.back(-1);return false;">取 消
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/lyear/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lyear/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lyear/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lyear/js/main.min.js"></script>
<script type="text/javascript">
</script>
</body>
</html>